<?php 
//get library
eval ("?>$library");
?>	            
 
<?php 
 //Set seo content
$seoData->setTitle($author->getName() . " (" . $_SERVER['SERVER_NAME'] . " Author)");
$seoData->setDescription("Author " . $author->getName() . " joined on " . date("M, d Y", $author->getCreated()) . ". " . $author->getAboutme());
$seoData->setKeywords("submit free article, free articles, submit articles, find articles, article search, articles search, free content, submit article, articles submission, submit your article, free article, free content articles, articles, article, articles directory, article directory");
$seoData->setOgSiteName($_SERVER['SERVER_NAME']);
$seoData->setOgTitle($author->getName() . " (" . $_SERVER['SERVER_NAME'] . " Author)");
$seoData->setOgDescription("Author " . $author->getName() . " joined on " . date("M, d Y", $author->getCreated()) . ". " . $author->getAboutme());
?> 
            <div class="container">            	
                <div class="row-fluid">

                    <!-- main content
                    ================================================== -->
                    <div id="mainContent" class="span8">
                        <div id="mainContent_inner" itemscope itemtype="http://schema.org/ItemList">
                        	
                        	<!-- user info
                    		================================================== -->
                            <?php 
                    		if ($author != NULL) {
                    		?>
                            <section class="authorInfo" itemscope itemtype="http://schema.org/Person">                                
                                <div class="well well-small">
                                    <div class="row-fluid">
                                        <div class="span3 thumbnails">
                                            <a href="#" class="thumbnail">
                                            	<?php 
                                            	if (isset($image) && !empty($image)) {
                                            	?>
                                            	<img itemprop="image" src="<?=$image?>=s120-c" />
                                            	<?php
                                            	} else {
                                            	?>
                                            	<img itemprop="image" src="<?=$baseUrl?>images/icon-author.jpg" />
                                            	<?php }?>
                                            </a>
                                        </div>
                                        <div class="span9">
                                            <h3><a href="/author/<?=$author->getId() ?>" itemprop="name"><?=$author->getName()?></a></h3>
                                            <p><a href="<?=$author->getWebsite()?>" itemprop="url"><?=$author->getWebsite()?></a></p>
                                            <p itemprop="description"><?=$author->getAboutme()?></p>
                                        </div>
                                    </div>
                                </div>
                            </section>
                            <?php 
                    		}
                            ?>
                        	
                        	<!-- Article listing
       						================================================== -->
                        	<meta itemprop="mainContentOfPage" content="true"/>
							<meta itemprop="itemListOrder" content="Descending" />
                            
                            <!-- Newest article
       						================================================== -->                            
       						<?php 
							foreach ($articles as $key => $article) {
							?>
                            <article itemscope itemtype="http://schema.org/Article" itemprop="itemListElement">
                                <h3 class="articleTitle" itemprop="name"><a href="/article/<?=$article->getAlias()?>"><?=$article->getTitle()?></a></h3>
                                <div class="row-fluid">
                                        <div class="articleMeta clearafter">
                                        	<?php 
											$category = $categories[$article->getCategory()];
											?>
                                            <a itemprop="author" href="<?=$author === NULL ? "#" : "/author/".$author->getId() ?>"><i class="icon-user"></i> <?=$author === NULL ? $article->getAuthorName : $author->getName()?> </a>
                                            | 
                                            <a href="/category/<?=$category === NULL ? "" : $category->getAlias() ?>"><i class="icon-folder-close"></i> <?=$category === NULL ? "" : $category->getName()?></a> 
                                            |
                                            <span itemprop="dateCreated"><i class="icon-calendar"></i> <?=date("M, d Y", $article->getCreated())?></span>                                    
                                            <meta content="UserComments:5" itemprop="interactionCount">
                                        </div>
                                        <div class="entry" itemprop="description">                                           
                                            <p><?=substr(trim(strip_tags($article->getContent())),0, 200)?></p>
                                        </div>
                                        <a href="/article/<?=$article->getAlias()?>" class="btn btn-small"><i class="icon-plus-sign"></i> Read more</a>
                                </div>
                            </article>
                            <?php
							} 
                            ?>
                            
                            <!-- Pagination
        					================================================== -->
                            <div class="pagination pagination-right">
                                <ul>
	                                <?php 
									$range = $paginator->getRangePage();
									?>
									<?php 
									if ($prevPage) {
									?>
                                	<li><a href="<?=$paginator->getPrev() ?>">Prev</a></li>
									<?php 
									}
									if ($nextPage || $prevPage) {
										for ($i = 0; $i < count($range); $i++) {
									 ?>
                                    <li class="<?=$range[$i] == $pages ? "disabled" : ""?>"><a href="<?=$paginator->getPage($range[$i])?>"><?=$range[$i] ?></a></li>
                                    <?php 
										}
									}
									if ($nextPage) {
									?>
									<li><a href="<?=$paginator->getNext() ?>">Next</a></li>
									<?php } ?>
                                </ul>
                            </div>
                        </div>
                    </div>

                    <!-- sidebar
                    ================================================== -->
                    <div class="span4">
                        <aside>
                        
                        	<!-- Search
        					================================================== -->
                        	<div class="module-2">
                                <h3 class="title">Search this site</h3>
                                <div class="moduleContent">
                                    <form method="get" action="/search" class="form-inline">
                                    	<input type="text" placeholder="Search article" class="" name="q"  />
                                        <button type="submit" class="btn">Search</button>
                                    </form>
                                </div>
                            </div>
                            
                            <!-- Adv
        					================================================== -->
                            <div class="module-2">                                
                                <div class="moduleContent adv-sidebar">
                                    <!-- Adv adsense BEGIN -->
                                    <script type="text/javascript"><!--
									google_ad_client = "ca-pub-2883566427648799";
									/* 300x250 */
									google_ad_slot = "2688877886";
									google_ad_width = 300;
									google_ad_height = 250;
									//-->
									</script>
									<script type="text/javascript"
									src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
									</script>
                                    <!-- Adv adsense END -->
                                </div>
                            </div>
                            
                            <!-- Recent article
        					================================================== -->
                            <div class="module-6">
                                <h3 class="title">Recent article view</h3>
                                <div class="moduleContent">
                                    <ul class="listingStyle" itemscope itemtype="http://schema.org/ItemList">
                                    	<?php 
                                    	foreach ($lastestArticles as $key => $article) {
                                    	?>
                                    	<li itemscope itemtype="http://schema.org/Article" itemprop="itemListElement">
                                        	<h5 itemprop="name" class="articleTitle"><a href="/article/<?=$article->getAlias()?>" itemprop="url"><?=$article->getTitle()?></a></h5>
                                            <span itemprop="dateCreated"><?=date("M, d Y", $article->getCreated())?></span>
                                        </li>
                                        <?php 
                                    	}
                                        ?>
                                    </ul>
                                </div>
                            </div>
                            
                            <!-- Categories
        					================================================== -->
                            <div class="module-6">
                                <h3 class="title">Categories</h3>
                                <div class="moduleContent">
                                    <ul class="listingStyle" itemscope itemtype="http://schema.org/ItemList">
                                    	<?php
                                    	foreach ($lstCategories as $key => $category) { 
                                    	?>
                                    	<li itemprop="itemListElement"><i class="icon-share-alt"></i> <a itemprop="url" href="/category/<?=$category->getAlias()?>"><span itemprop="name"><?=$category->getName()?></span></a></li>
                                    	<?php } ?>
                                    </ul>
                                </div>
                            </div>
                            
                            <!-- Tags
        					================================================== -->
                            <div class="module-2">
                            	<h3 class="title">Tags</h3>                            
                                <div class="moduleContent" itemscope itemtype="http://schema.org/CreativeWork">
                                	<?php 
                                	foreach ($tags as $key => $tag) {
                                	?>
                                    <a href="/tag/<?=urlencode($tag)?>" class="label label-info" itemprop="keywords"><?=$tag?></a>
                                    <?php 
                                	}
                                    ?>
                                </div>
                            </div>
                        </aside>
                    </div>                                                
                </div>
            </div>
